// 定义货币列表数据
const currencyList = [
    {
        name: uni.getStorageSync('lang') == 'zh' ? '人民币' : 'рубль',
        symbol: '¥',
        code: 'CNY',
		nameSym: (uni.getStorageSync('lang') == 'zh' ? '人民币' : 'рубль') + '-' + '¥',
        country: uni.getStorageSync('lang') == 'zh' ? '中国' : 'Китай'
    },
    {
        name: uni.getStorageSync('lang') == 'zh' ? '卢布' : 'рубль',
        symbol: '₽',
        code: 'RUB',
		nameSym: (uni.getStorageSync('lang') == 'zh' ? '卢布' : 'рубль') + '-' + '₽',
        country: uni.getStorageSync('lang') == 'zh' ? '俄罗斯' : 'Россия'
    },
    {
        name: uni.getStorageSync('lang') == 'zh' ? '坚戈' : 'тенге',
        symbol: '₸',
        code: 'KZT',
		nameSym: (uni.getStorageSync('lang') == 'zh' ? '坚戈' : 'тенге') + '-' + '₸',
        country: uni.getStorageSync('lang') == 'zh' ? '哈萨克斯坦' : 'Казахстан'
    },
    {
        name: uni.getStorageSync('lang') == 'zh' ? '白俄罗斯卢布' : 'Белорусский рубль',
        symbol: 'Br',
        code: 'BYN',
		nameSym: (uni.getStorageSync('lang') == 'zh' ? '白俄罗斯卢布' : 'Белорусский рубль') + '-' + 'Br',
        country: uni.getStorageSync('lang') == 'zh' ? '白俄罗斯' : 'Беларусь'
    },
    {
        name: uni.getStorageSync('lang') == 'zh' ? '索姆' : 'сом',
        symbol: 'сом',
        code: 'KGS',
		nameSym: (uni.getStorageSync('lang') == 'zh' ? '索姆' : 'сом') + '-' + 'сом',
        country: uni.getStorageSync('lang') == 'zh' ? '吉尔吉斯斯坦' : 'Киргизия'
    },
    {
        name: uni.getStorageSync('lang') == 'zh' ? '苏姆' : 'сўм',
        symbol: 'сўм',
        code: 'UZS',
		nameSym: (uni.getStorageSync('lang') == 'zh' ? '苏姆' : 'сўм') + '-' + 'сўм',
        country: uni.getStorageSync('lang') == 'zh' ? '乌兹别克斯坦' : 'Узбекистан'
    },
    {
        name: uni.getStorageSync('lang') == 'zh' ? '马纳特' : 'Манат',
        symbol: 'Манат',
        code: 'TMT',
		nameSym: (uni.getStorageSync('lang') == 'zh' ? '马纳特' : 'Манат') + '-' + 'Манат',
        country: uni.getStorageSync('lang') == 'zh' ? '土库曼斯坦' : 'Туркменистан'
    },
    {
        name: uni.getStorageSync('lang') == 'zh' ? '格里夫纳' : 'гривна',
        symbol: '₴',
        code: 'UAH',
		nameSym: (uni.getStorageSync('lang') == 'zh' ? '格里夫纳' : 'гривна') + '-' + '₴',
        country: uni.getStorageSync('lang') == 'zh' ? '乌克兰' : 'Украина'
    },
    {
        name: uni.getStorageSync('lang') == 'zh' ? '索莫尼' : 'сомон',
        symbol: 'сомон',
        code: 'TJS',
		nameSym: (uni.getStorageSync('lang') == 'zh' ? '索莫尼' : 'сомон') + '-' + 'сомон',
        country: uni.getStorageSync('lang') == 'zh' ? '塔吉克斯坦' : 'Таджикистан'
    }
];

/**
 * 根据货币代码获取对应的货币符号
 * @param {string} code - 货币代码
 * @returns {string} 货币符号
 */
const getSymboleByCode = (code) => {
    const currency = currencyList.find(item => item.code === code);
    return currency?.symbol || null;
};


export default {
    currencyList,
    getSymboleByCode
}
